﻿<%@ Page Language="C#" MasterPageFile="~/user.master" AutoEventWireup="true" Inherits="MediaMonitor.Users.UserCart"
    Title="User Cart" CodeBehind="cart.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">

    <telerik:RadAjaxPanel ID="pnlRad" runat="server" RestoreOriginalRenderDelegate="false">
        <center>
         <br class="clear" />
    <h2 class="title"><span></span></h2>
    
    <div class="user-cart">

        <asp:Label ID="lblMsg" runat="server" SkinID="Error" /><br />

        <telerik:RadGrid ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
            AllowSorting="True" GridLines="Both" OnNeedDataSource="radGrid_NeedDataSource"
            OnPreRender="radGrid_PreRender" PageSize="40" ItemStyle-Font-Size="Smaller"  
             OnItemCommand="radGrid_ItemCommand">
            <MasterTableView Name="Cart" ShowFooter="true" CssClass="aqua_table" ItemStyle-BorderWidth="1" DataKeyNames="ProdVersionID, ProdVersionName, ProductID, ProductName, Price"
            NoMasterRecordsText="Cart is empty" >
                <FooterStyle Font-Bold="true" ForeColor="AliceBlue" />
                <Columns> 
                    <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <%#Container.ItemIndex+1%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    
                    <telerik:GridTemplateColumn HeaderText="Type">
                        <ItemTemplate>
                            <%#MediaType.Query().SetSelectList("MediaTypeName").WHERE("MediaTypeCode", Eval("MediaTypeCode")).ExecuteScalar()%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product" UniqueName="Product" /> 
                    <telerik:GridBoundColumn DataField="ProdVersionName" HeaderText="Version" UniqueName="Program" />
                    
                     <telerik:GridTemplateColumn HeaderText="Preview" HeaderStyle-Font-Size="Smaller">
                        <ItemTemplate>
                            <!--for TV-->
                            <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/video.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                <span style='color: <%# Utility.ToBool(Eval("ShortVideo"))==true ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode"))==1 && Utility.CheckVideoAvailability(Utility.ToStr(Eval("ShortVideoFile")).ToString()), "Preview", "")%>
                                </span></a>
                            <!--for RADIO-->
                            <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/radio.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                <span style='color: <%# Utility.ToStr(Eval("RadioFile"))!="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode"))==3 &&  Utility.CheckRadioAvailability(Utility.ToStr(Eval("RadioFile")).ToString()), "Preview", "")%>
                                </span></a>
                            <!--for CABLE-->
                            <a href="javascript:void(0);" onclick="PopupCenter('../sitefiles/cable.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s', '_blank', 350, 280); ">
                                <span style='color: <%# Utility.ToStr(Eval("CableFile"))=="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 5 &&  Utility.CheckCableAvailability(Utility.ToStr(Eval("CableFile")).ToString()), "Preview", "")%>
                                </span></a>
                            <!--for PRESS-->
                            <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/press.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("PressFile")%>', '_blank', 750, 700); ">
                                <span style='color: <%# Utility.ToStr(Eval("PressFile"))!="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 6 &&  Utility.CheckPressAvailability(Utility.ToStr(Eval("PressFile")).ToString()), "Preview", "")%>
                                </span></a>
                            <!--for OutDoor-->
                            <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/outdoor.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("OutDoorFile")%>', '_blank', 750, 700); ">
                                <span style='color: <%# Utility.ToStr(Eval("OutDoorFile"))!="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 7 &&  Utility.CheckOutDoorAvailability(Utility.ToStr(Eval("OutDoorFile")).ToString()), "Preview", "")%>
                                </span></a>

                                 <!--for INTERNET-->
                            <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/internet.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("PressFile")%>', '_blank', 750, 700); ">
                                <span style='color: <%# Utility.ToStr(Eval("PressFile"))!="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 9 &&  Utility.CheckInternetAvailability(Utility.ToStr(Eval("PressFile")).ToString()), "Preview", "")%>
                                </span></a>

                                </span></a>
                        </ItemTemplate>
                      </telerik:GridTemplateColumn>
                     
                    <telerik:GridBoundColumn DataField="Price" HeaderText="Price" DataFormatString="{0:C2}" Aggregate="Sum" FooterAggregateFormatString="{0:C2}" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" />
                   
                    <telerik:GridButtonColumn ConfirmText="Are you sure to remove this item from Shopping Cart?" CommandName="Remove" ButtonType="LinkButton" Text="Remove" />
                </Columns>
            </MasterTableView>
             
        </telerik:RadGrid>
            
              </div>
    <br class="clear" />
    <br />
    <div class="user-cart-btn">
    <div class="clear-cart">
                <asp:LinkButton ID="lnkClearCart" runat="server" Text="Clear Cart" OnClick="lnkClearCart_Click" CssClass="Error"></asp:LinkButton>
             </div>
    <div class="checkout">
                <asp:LinkButton ID="lnkCheckout" runat="server" Text="Checkout" OnClick="lnkCheckout_Click" CssClass="Heading"></asp:LinkButton>
          </div>
            <p></p>
<p></p>
    </div>
  
        </center>
        

    </telerik:RadAjaxPanel>
  

</asp:Content>

